function [r,c] = indexit ( data, matlab_index )
% INDEXIT:  converts column major index number to row and column
%
% USAGE:  [r,c] = indexit ( data, matlab_index )      
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% $Name: rslice-0_9_2 $
% $Id: indexit.m,v 1.2 2005/05/26 21:46:09 jevans Exp $
% AUTHOR:  johnevans@acm.org
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[num_rows, num_cols] = size(data);
r = mod(matlab_index-1,num_rows)+1;
c = (matlab_index-r)/num_rows + 1;

